//
//  BGAddlistWithaccessoryViewModel.m
//  bigMall
//
//  Created by LTOVE on 16/8/9.
//  Copyright © 2016年 thinklev. All rights reserved.
//

#import "BGAddlistWithaccessoryViewModel.h"

#import "LTOVEPickView.h"

@interface BGAddlistWithaccessoryViewModel ()<datePickDelegate>

@end


@implementation BGAddlistWithaccessoryViewModel



- (AddListOption)option
{
    

   
    
    
    void(^myOption)() = ^(){
        

        
//        NSLog(@"%@",self.dataArray);
//        [self.dataArray writeToFile:@"/Users/LTOVE/Desktop/xxxx.plist" atomically:YES];
        LTOVEPickView *view = [[LTOVEPickView alloc]init];
        
        if (self.isDatePick) {
            view  = [LTOVEPickView dateObjWithHeigh:180 andPickModel:UIDatePickerModeDate andDateFormStr:@"yyyy-MM-dd"];
            view.delegate = self;
            [view initDatePickViewValue];
        }else{
            view  = [LTOVEPickView showPickViewWithHeigh:180 andDateArray:self.dataArray];
//            if (1) {
//                view  = [LTOVEPickView showPickViewWithHeigh:180 andDateArray:self.dataArray];
//            }else{
////            view  = [LTOVEPickView showPickViewWithHeigh:180 andDateArray:self.dataArray];
//                view = [LTOVEPickView showPickViewWithHeigh:180 andDateArray:self.dataArray andInitSelectArray:@[self.defaultStr]];
//            }
            view.delegate = self;
            [view initPickViewValue];
        }
        view.frame = BGKeyWindow.bounds;
        
        
        [BGKeyWindow addSubview:view];
        
    };
    
    return myOption;
}

#pragma pickView代理方法

- (void)dateStrimgWithFormStr:(NSString *)formStr
{
//    GWLog(@"%@",formStr);
    [self statementPickValueChangedDelegate:formStr];
}

- (void)pickViewChangedWithStr:(NSString *)Str
{
//    GWLog(@"%@",Str);
    self.defaultStr = Str;
    [self statementPickValueChangedDelegate:Str];

}

- (void)statementPickValueChangedDelegate:(NSString *)str
{
    if ([_delegate respondsToSelector:@selector(pickViewValueChanged:)]) {
        [_delegate pickViewValueChanged:str];
    }
}

@end
@implementation BGShopAddListBasicModelType4



@end
